/**
 * 获取导航栏信息
 * 返回值：
 * height: 0, //整个navbar的高度
 * contentHeight: 0, //navbar内容区域的高度
 * statusBarHeight: 0, //状态栏高度
 * menuButtonInfo: {}, //胶囊信息
 * 调用：
 * ```js
 * const {height,contentHeight,statusBarHeight,menuButtonInfo} = useGetNavInfo();
 * ```
 */
import { reactive, toRefs } from "vue";

export default () => {
  const navInfo = reactive({
    height: 0, //整个navbar的高度
    contentHeight: 0, //navbar内容区域的高度
    statusBarHeight: 0, //状态栏高度
    menuButtonInfo: {}, //胶囊信息
  });

  helper.getNavBarHeight().then((res) => {
    navInfo.height = res.height;
    navInfo.contentHeight = res.contentHeight;
    navInfo.statusBarHeight = res.statusBarHeight;
    navInfo.menuButtonInfo = res.menuButtonInfo;
  });

  return {
    ...toRefs(navInfo),
  };
};
